import axios from 'axios';
// 获取账号信息并判断权限
async function checkSuperAdmin(){
    try {
        const token = localStorage.getItem('token');
        const response = await axios.get('/api/account', {
            headers: {
                Authorization: `Bearer ${token}`
            }
        });
        return response.data.permission_level === 0;    // 是否超级管理员
    } catch (error) {
        console.error('获取账号信息失败:', error);
        return false;
    }
}

export { checkSuperAdmin };
